$(function(){
	if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){ 
		var timer;
		$('.iNav>li').mouseenter(function(){ 
			$(this).parentsUntil(".zggISubNav").addClass("active1");
			$(this).addClass("active");
			var i=$(this).index();
			$('.iSubNav>div').addClass("zgganimate").removeClass("iSubNavDivZ");
			$('.iSubNav>div:eq('+i+')').removeClass("zgganimate").addClass("iSubNavDivZ");
		}).mouseleave(function(){ 
			$(this).parentsUntil(".zggISubNav").removeClass("active1");
			$(this).removeClass("active");
			timer = setInterval(function() {
				$('.iSubNav>div:eq('+i+')').addClass("zgganimate").removeClass("iSubNavDivZ");
			}, 10);
		});
		$(".iSubNav>div").mouseenter(function(){ 
			clearInterval(timer);
			var i=$(this).index();
			$('.zggNaSubSub .iNav li:eq('+i+')').parentsUntil(".zggISubNav").addClass("active1");
			$('.zggNaSubSub .iNav li:eq('+i+')').addClass("active");
		}).mouseleave(function(){ 
			var i=$(this).index();
			$('.zggNaSubSub .iNav li:eq('+i+')').parentsUntil(".zggISubNav").removeClass("active1");
			$('.zggNaSubSub .iNav li:eq('+i+')').removeClass("active");
			$('.iSubNav>div:eq('+i+')').addClass("zgganimate").removeClass("iSubNavDivZ");
		});
		$(".zggNaSubSub").mouseleave(function(){ 
			$('.zggNaSubSub .iNav li').parentsUntil(".zggISubNav").removeClass("active1");
			$('.zggNaSubSub .iNav li').removeClass("active");
			$('.iSubNav>div').addClass("zgganimate").removeClass("iSubNavDivZ");
		}); 
		$(".zggNaSub").mouseenter(function(){ 
			$('.zggNaSubSub').addClass("noIsHome");
		}).mouseleave(function(){ 
			$('.zggNaSubSub').removeClass("noIsHome");
		});
	}else{
		navHover();
		function navHover(){
	
			var bBut = true;
			var iSubNavDivZ = "iSubNavDivZ";
			var active = "active";
			var active1 = "active1";
			var noIsHome = "noIsHome";
			var zgganimate = "zgganimate";
			var overflowInherit = "headerOverflowInherit";
			var iNavlis = $(".iNav li");
			var iNavLi = $(".iNav li");
			var zggNaSuba = $(".zggNaSub");
			var iSubNavdiv = $(".iSubNav > div");
			var zggNaSubSub = $(".zggNaSubSub");
			var aninmatHover = $(".zggNaSubSub > .iSubNav > div");
			var zggNaBorder = $(".zggNaSubSub > .zggISubNav > li");
			var zggNaBorderRight=$(".zggNaSubSub > .zggISubNav");
			var noIsHomeObj = $(".zggNaSub .zggNaSubSub");
			var classification = $(".zggNaSub > a .classification");
			var classification1 = "classification1";
			
			//全服务分类二级导航效果
			iNavlis.on("mouseenter mouseleave",function(e){
	
				var index = $(this).index();
				var iNavBbj = $(this).parents(".zggISubNav").next(".iSubNav").children("div");
				var zggNaSubSubObj = $(this).parents(".zggNaSubSub");
				if (e.type == "mouseenter") {
					iNavBbj.eq(index).addClass(iSubNavDivZ);
					iNavlis.eq(index).addClass(active);
					zggNaSubSubObj.addClass(overflowInherit);
				}else if (e.type == "mouseleave") {
					iNavBbj.removeClass(iSubNavDivZ);
					iNavlis.eq(index).removeClass(active);
				};
			});
			//全服务分类二级导航右侧效果
			iSubNavdiv.on("mouseenter mouseleave",function(e){
				var index1 = $(this).index();
				if (e.type == "mouseenter") {
					$(this).addClass(iSubNavDivZ);
					iNavlis.eq(index1).addClass(active);
				}else if (e.type == "mouseleave") {
					$(this).removeClass(iSubNavDivZ);
					iNavlis.eq(index1).removeClass(active);
				};
			});
	
			//鼠标移进导航区和移出导航区时效果
			zggNaSubSub.on("mouseenter mouseleave",function(e){
				if (e.type == "mouseenter") {
					aninmatHover.removeClass(zgganimate);
					zggNaBorder.addClass(active);
					zggNaBorderRight.addClass(active1);
					classification.addClass(classification1);
				}else if (e.type == "mouseleave") {
					aninmatHover.addClass(zgganimate);
					zggNaBorder.removeClass(active);
					zggNaBorderRight.removeClass(active1);
					iNavLi.removeClass(overflowInherit);
					classification.removeClass(classification1);
				};
			});
	
			//全服务分类导航收起和展开效果
			zggNaSuba.on("mouseenter mouseleave",function(e){
				if (e.type == "mouseenter") {
					$(this).children(".zggNaSubSub").addClass(noIsHome);
				}else if (e.type == "mouseleave") {
					$(this).children(".zggNaSubSub").removeClass(noIsHome);
					iNavLi.parents(".zggNaSubSub").removeClass(overflowInherit);
				};
				e.stopPropagation();
			});
		}	
	}
});